08. Moveit! Basics

What is Moveit!?

MoveIt! is an advanced motion planning framework for manipulation, kinematics, and control. It provides a platform for developing advanced robotics applications, evaluating new robot designs and building integrated robotics products for industrial, commercial, R&D, and other domains.

We will be leveraging various components of Moveit! for different projects throughout this program, as such, we will explore individual components of Moveit! as required. For now let us take a look at core components and how they fit into this project.

The Planning Scene

The planning scene represents the state of the robot as well as the state of the world around it.

It tracks the robot state by subscribing to the joint_states topic. It integrates information from various sensors like Stereo cameras, and/or RGBD cameras to essentially create a 3D map of the dynamic environment around the robot.

You may also insert abstract or virtual objects into this so called 3D map by publishing them to specific topics.

Motion Planning

MoveIt! does not have an inbuilt motion planning algorithm. Instead it provides a convenient plugin interface to communicate with and use various motion planning libraries.

Moveit! utilizes a special ROS Service to establish a request-response relationship with any given motion planner.

As you learned in ROS Essentials, unlike pub-sub, request-response relationship relies on very specific messages being passed between two nodes. In this case, once a motion planner is selected and loaded via the plugin interface, you can send a request message to the planner with specific instructions on how to generate the plan.

To understand this, imagine you are at a fancy restaurant, you would like to order a specific dish but have dietary constraints/preferences, so you order the dish but also add in instructions like make it less spicy or leave out the nuts. Moveit! does something similar, in the request message for plan, you can add instructions like path constraints, trajectory constraints, time allowed for the planner to plan, maximum velocity allowed, etc.

In response to our request message, Moveit! generates a desired collision free trajectory using the Planning Scene discussed above.

A point to be noted is that a motion planner only generates a collision free path from the start state of the robot to its end state, and then Moveit! converts this path into a joint space trajectory which obeys velocity and acceleration constraints for joint angles.

Once you have a valid collision free trajectory, you can execute it using proper controllers for your robot. You will learn in detail about various types of controllers and their usage in the Controls module.

Kinematics

At various stages in the process of motion planning, Moveit! needs to convert the joint_state of the robot into the end-effector pose using Forward Kinematics, and vice-versa using Inverse Kinematics.

While ROS’ RobotState class provides access to Forward Kinematics functionality, Moveit! Allows users to write their own Inverse Kinematics implementations. For this project, this is the part you will implement, first mathematically and then in the form of a python script.

While your python script only solves IK for a specific 6DOF robot arm (Kuka KR210), there are generalized libraries and plugins which can be used to solve IK for different types of robots. A couple of widely used solutions are:

The move_group node

The move_group node is the primary node of the Moveit! package and serves as a central hub, providing communication across almost all components of Moveit!

It provides the user interface in the form of Rviz GUI and it talks to the robot on various topics to get information like robot state, transformations, sensor data, controller state, etc. We will talk about this node extensively in future modules for motion planning.